<?
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."catalog` CHANGE `groupe` `groupe` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."catalog` CHANGE `dlink` `dlink` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."catalog` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."data` CHANGE `name` `name` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."data` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."discribe` CHANGE `name` `name` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."discribe` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."discribe` CHANGE `type_of_value` `type_of_value` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."object_data` CHANGE `name` `name` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."object_data` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."sessions` CHANGE `ip` `ip` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."users_data` CHANGE `name` `name` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
	$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."users_data` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);

	$row = array();
	$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."catalog`", __LINE__, __FILE__);
	if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r;
	if (!array_key_exists('pos', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."catalog` ADD INDEX (`pos`)", __LINE__, __FILE__);
	if (!array_key_exists('parent', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."catalog` ADD INDEX (`parent`)", __LINE__, __FILE__);
	if (!array_key_exists('lang', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."catalog` ADD INDEX (`lang`)", __LINE__, __FILE__);
	if (!array_key_exists('dlink', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."catalog` ADD INDEX (`dlink`)", __LINE__, __FILE__);
	if (!array_key_exists('type', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."catalog` ADD INDEX (`type`)", __LINE__, __FILE__);
	
	$row = array();
	$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."data`", __LINE__, __FILE__);
	if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
	if (!array_key_exists('pos', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."data` ADD INDEX (`pos`)", __LINE__, __FILE__);
	if (!array_key_exists('parent', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."data` ADD INDEX (`parent`)", __LINE__, __FILE__);
	if (!array_key_exists('name', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."data` ADD INDEX (`name`)", __LINE__, __FILE__);
	if (!array_key_exists('type', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."data` ADD INDEX (`type`)", __LINE__, __FILE__);

	$row = array();
	$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."discribe`", __LINE__, __FILE__);
	if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
	if (!array_key_exists('name', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."discribe` ADD INDEX (`name`)", __LINE__, __FILE__);
	if (!array_key_exists('type', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."discribe` ADD INDEX (`type`)", __LINE__, __FILE__);
	if (!array_key_exists('type_of_value', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."discribe` ADD INDEX (`type_of_value`)", __LINE__, __FILE__);

	$row = array();
	$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."object_data`", __LINE__, __FILE__);
	if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
	if (!array_key_exists('name', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."object_data` ADD INDEX (`name`)", __LINE__, __FILE__);
	if (!array_key_exists('type', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."object_data` ADD INDEX (`type`)", __LINE__, __FILE__);

	if (isset($setupdata['modules']['clients']['is'])){
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."client_data` CHANGE `name` `name` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."client_data` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."client_groups` CHANGE `name` `name` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);	
		$row = array();
		$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."client`", __LINE__, __FILE__);
		if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
		if (!array_key_exists('email', $row)) {
			$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."client` ADD INDEX ( `email` ) ", __LINE__, __FILE__);
		}
	}
	
	if (isset($setupdata['modules']['shop']['is'])){
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_catalog` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_data` CHANGE `name` `name` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_data` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_discribe` CHANGE `name` `name` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_discribe` CHANGE `type` `type` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_discribe` CHANGE `type_of_value` `type_of_value` VARCHAR( 255 ) NOT NULL", __LINE__, __FILE__);		
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_catalog` ADD INDEX (`parent`) ", __LINE__, __FILE__);
		$sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_catalog` ADD INDEX (`type`) ", __LINE__, __FILE__);
		
		$row = array();
		$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."product_data`", __LINE__, __FILE__);
		if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
		if (!array_key_exists('parent', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_data` ADD INDEX (`parent`) ", __LINE__, __FILE__);
		if (!array_key_exists('name', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_data` ADD INDEX (`name`) ", __LINE__, __FILE__);
		if (!array_key_exists('type', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_data` ADD INDEX (`type`) ", __LINE__, __FILE__);

		$row = array();
		$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."product_discribe`", __LINE__, __FILE__);
		if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
		if (!array_key_exists('name', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_discribe` ADD INDEX (`name`)", __LINE__, __FILE__);
		if (!array_key_exists('type', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_discribe` ADD INDEX (`type`)", __LINE__, __FILE__);
		if (!array_key_exists('type_of_value', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_discribe` ADD INDEX (`type_of_value`)", __LINE__, __FILE__);

		$row = array();
		$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."product_groups`", __LINE__, __FILE__);
		if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
		if (!array_key_exists('parent', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_groups` ADD INDEX (`parent`)", __LINE__, __FILE__);
		if (!array_key_exists('type', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."product_groups` ADD INDEX (`type`)", __LINE__, __FILE__);
	}
	
	if (isset($setupdata['modules']['shop_cart']['is'])){
		$row = array();
		$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."shop_cart`", __LINE__, __FILE__);
		if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
		if (!array_key_exists('user_id', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."shop_cart` ADD INDEX (`user_id`)", __LINE__, __FILE__);
		if (!array_key_exists('product_id', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."shop_cart` ADD INDEX (`product_id`)", __LINE__, __FILE__);

		$row = array();
		$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."shop_cart_products`", __LINE__, __FILE__);
		if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
		if (!array_key_exists('order_id', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."shop_cart_products` ADD INDEX (`order_id`)", __LINE__, __FILE__);		
		if (!array_key_exists('product_id', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."shop_cart_products` ADD INDEX (`product_id`)", __LINE__, __FILE__);		

		$row = array();
		$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$setupdata['table_prefix']."shop_cart_products_data`", __LINE__, __FILE__);
		if (mysql_num_rows($sql) > 0) while ($r = mysql_fetch_array($sql, MYSQL_NUM)) $row[$r[4]] = $r[4];
		if (!array_key_exists('order_id', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."shop_cart_products_data` ADD INDEX (`order_id`)", __LINE__, __FILE__);		
		if (!array_key_exists('product_id', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."shop_cart_products_data` ADD INDEX (`product_id`)", __LINE__, __FILE__);		
		if (!array_key_exists('name', $row)) $sql = $mysqlclass->mysql_my_query("ALTER TABLE `".$setupdata['table_prefix']."shop_cart_products_data` ADD INDEX (`name`)", __LINE__, __FILE__);
	}
?>